﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace NJL.Web.Controls
{
    public partial class WUEnterPriseSpaceLeftBook : BaseUserControl
    {
        private readonly NJL.BLL.NJL_SYS_BASE bllBase = new BLL.NJL_SYS_BASE();
        private readonly NJL.BLL.NJL_BOOK bllBook = new BLL.NJL_BOOK();
        private readonly NJL.BLL.NJL_COMPANY bllCompany = new BLL.NJL_COMPANY();
        private readonly NJL.BLL.NJL_BOOK_ORDER bllBookOrder = new BLL.NJL_BOOK_ORDER();
        protected NJL.Model.NJL_SYS_BASE MODEL_BASE;
        protected IList<Model.NJL_BOOK> LIST_BOOK;
        protected NJL.Model.NJL_COMPANY modelCompany;


        protected void Page_Load(object sender, EventArgs e)
        {
            //获取订票信息

            LIST_BOOK = bllBook.GetModelList(" NJL_SYS_BASE_ID='" + WEBSITE_CODE + "' AND TYPE_CODE='2' AND TARGET_ID='" + Request.QueryString["id"] + "' ");
            MODEL_BASE = bllBase.GetModel(WEBSITE_CODE);
            modelCompany = bllCompany.GetModel(Request.QueryString["id"]);

            DataSet ds = bllCompany.GetAllList("NJL_SYS_BASE_ID='" + WEBSITE_CODE + "' and IS_OPEN_BOOK=1 and AUDIT_STATE=1");
            litBookCount.Text = ds.Tables[0].Rows.Count.ToString();
            litOrderCount.Text = bllBookOrder.GetOrderCountByUser().ToString();
            ds = bllBookOrder.GetList("NJL_SYS_BASE_ID='" + WEBSITE_CODE + "'");
            litOrderNum.Text = ds.Tables[0].Rows.Count.ToString();
        }
    }
}